<template>
	<a-modal :width="500" :visible="visible" title="音频配置" @ok="handleOk" @cancel="handleClose" centered>
		<div class="form_con">
			<div class="form_item">
				<div class="form_title">语气</div>
				<a-select v-model:value="operateForm.voice_type" style="width: 100%; margin-left: 20px;"
					placeholder="请选择语气" :options="selectOptions"></a-select>
			</div>
			<div class="form_item">
				<div class="form_title">语速</div>
				<a-col :span="12" style="margin-left: 20px;">
					<a-slider :min="0" :max="120" v-model:value="operateForm.sincenAudio" />
				</a-col>
				<a-input-number :min="0" :max="120" style="width: 120px; margin-left: 20px;"
					v-model:value="operateForm.sincenAudio" />
			</div>

			<div class="form_item">
				<div class="form_title">音调</div>
				<a-col :span="12" style="margin-left: 20px;">
					<a-slider :min="0" :max="120" v-model:value="operateForm.videoVoice" />
				</a-col>
				<a-input-number :min="0" :max="120" style="width: 120px; margin-left: 20px;"
					v-model:value="operateForm.videoVoice" />
			</div>
		</div>

		<template #footer>
			<a-button type="primary">试听</a-button>
			<a-button type="primary" style="margin-left: 10px;">保存</a-button>
		</template>
	</a-modal>
</template>

<script>
	import {
		defineComponent,
		reactive,
		toRefs,
		computed,
		watch,
		toRaw,
		createVNode,
		ref,
		nextTick,
	} from "vue";
	import {
		FolderAddOutlined,
		MinusOutlined,
		PlusOutlined
	} from "@ant-design/icons-vue";

	export default defineComponent({
		props: {
			visible: {
				type: Boolean,
				default: false
			}
		},

		components: {
		},

		setup(props, context) {
			const state = reactive({
				operateForm: {
					sincenAudio: 100,
					videoVoice: 0,
					voice_type: null
				},
				selectOptions: [{
					label: '开心',
					value: 1
				}]
			});

			const handleOk = () => {
				context.emit('close')
			}

			const handleClose = () => {
				context.emit('close')
			}

			watch(() => props.visible, val => {
			})

			return {
				...toRefs(state),
				handleOk,
				handleClose
			}
		},
	});
</script>

<style lang="less" scoped>
	.form_con {
		.form_item {
			display: flex;
			align-items: center;
			margin-top: 10px;

			.form_title {
				width: 70px;
				flex-shrink: 0;
				display: flex;
				align-items: center;
				justify-content: flex-end;
			}
		}
	}
</style>